import { Notification } from "element-ui";
let notification = null;
export const errorInfo = (message, title = '失败信息') => {
    !notification && (notification = Notification.error({
        title,
        dangerouslyUseHTMLString: true,
        message: `<strong>信息：</strong> ${message}`,
        duration: 3000,
        onClose: () => notification = null
    }));
}

export const info = (message, title = '操作信息') => {
    !notification && (notification = Notification.info({
        title,
        dangerouslyUseHTMLString: true,
        message: `<strong>信息：</strong> ${message}`,
        duration: 2000,
        onClose: () => notification = null
    }));
}

export const success = (message, title = '成功信息') => {
    !notification && (notification = Notification.success({
        title,
        dangerouslyUseHTMLString: true,
        message: `<strong>信息：</strong> ${message}`,
        duration: 2000,
        onClose: () => notification = null
    }));
}

export const warning = (message, title = '警告信息') => {
    !notification && (notification = Notification.warning({
        title,
        dangerouslyUseHTMLString: true,
        message: `<strong>信息：</strong> ${message}`,
        duration: 2000,
        onClose: () => notification = null
    }));
}